#include"TCP_server.hpp"
#include<iostream>
#include"Commend.hpp"

int main(int argc,char* argv[])
{
    if(argc!=2)
    {
        std::cout<<"Usage: ./TCPServer port"<<std::endl;
        exit(1);
    }

    uint16_t port=std::stoi(argv[1]);

    Commend C1;
    
    std::unique_ptr<server> r1=std::make_unique<server>(port,[&C1](std::string cmd, InetAddr &cli){
        return C1.Exuate(cmd,cli);
    });

    r1->Init();
    r1->Start();
    return 0;
}